<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>换背景颜色</title>
    <style>
        input {
            -webkit-appearance: none;
            width: 80px;
            height: 80px;
        }

        /* 设置按钮大小 */

        .div {
            width: 250px;
            height: 250px;
            border: solid;
            background-color: red;
            font-size: 37px;
        }

        /* 设置要换颜色的盒子背景颜色 */

        input:checked {
            border-radius: 50px;
        }

        /* 让按钮点击一下可以变形 */


        .lan:checked~div {
            background-color: yellow;
        }

        .red:checked~div {
            background-color: red;
        }

        .lse:checked~div {
            background-color: seagreen;
        }

        .zise:checked~div {
            background-color: violet;
        }

        .fense:checked~div {
            background-color: pink;
        }

        .lan {
            background-color: yellow;
        }

        .red {
            background-color: red;
        }

        .lse {
            background-color: seagreen;
        }

        .zise {
            background-color: violet;
        }

        .fense {
            background-color: pink;
        }
    </style>
</head>

<body>
    <input type="radio" name="btn" class="lan">
    <input type="radio" name="btn" class="red">
    <input type="radio" name="btn" class="lse">
    <input type="radio" name="btn" class="zise">
    <input type="radio" name="btn" class="fense">
    <div class="div">莫西莫西变颜色</div>
</body>

</html>